integer listen_id2;
integer channel_dialog2=13337;
integer reset;
integer attachment = TRUE;
integer relaychannel = -1812221819;
string cmdname;
integer gPlugin =1339;
key victim;

llRlvSay(string command)
{
	if(attachment==TRUE)
	{
		llOwnerSay("@"+command);
	}
	else
	{
		llSay(relaychannel,cmdname + "," + (string)victim  + "," + "@"+command);
	}
}

rlvActive()
{
	llMessageLinked(LINK_THIS, gPlugin, "ON_REZ", NULL_KEY);
}

default {
    state_entry() 
    {
        reset=1;
    }
    
    on_rez(integer bla)
    {
    	llRlvSay("version="+(string)channel_dialog2); 
		listen_id2 = llListen( channel_dialog2, "", NULL_KEY, "");
		llSetTimerEvent(60.0);
		
    }
    
    listen(integer channel, string name, key id, string message)
    {
    	llListenRemove(listen_id2);
    	llSetTimerEvent(0.0);
    	if(channel==channel_dialog2)
    	{
    		if(message!="")
    		{
    			rlvActive();
    		}
    	}
    }
    
    timer()
    {
    	llListenRemove(listen_id2);
    }
}
